<template>
  <el-tree-select
    v-model="searchValue"
    :data="config.option"
    :placeholder="
      config.placeholder
        ? config.placeholder
        : $t('component.search.input_placeholder') + config.label
    "
    clearable
    :disabled="config.disabled"
    size="default"
    teleported
    check-strictly
    :render-after-expand="false"
  >
  </el-tree-select>
</template>

<script setup>
import { computed } from "vue";

const props = defineProps(["model", "config"]);
const emit = defineEmits(["update"]);

const searchValue = computed({
  get() {
    return props.model;
  },
  set(value) {
    emit("update", props.config, value);
  },
});
</script>
